package com.share.lottery.activity.fab;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.share.lottery.R;
import com.share.lottery.adapter.SelectAdapter;
import com.share.lottery.base.BaseActivity;
import com.share.lottery.model.AddItem;

/**
 * @author 举报页面
 *
 */
public class ReportActivity extends BaseActivity{
	private SelectAdapter adapter;
	private ListView listContent;
	private TextView tvSure;
	private TextView tvCancle;
	private String[] jbs = {"不符合相关主题","垃圾营销","人身攻击、骚扰","涉嫌色情、暴力、政治等","不实信息","头像、昵称、签名等违规"};
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.report);
		init();
	}
		
	public void findView() {
		listContent = (ListView) findViewById(R.id.list_content);
		tvSure = (TextView) findViewById(R.id.tv_sure);
		tvCancle = (TextView) findViewById(R.id.tv_cancle);
	}

	public void getData() {
	
	}

	@Override
	public void initTitle() {
		// TODO Auto-generated method stub
		
	}

	
	public void setData() {
	List<AddItem> addItems = new ArrayList<AddItem>();
	if (adapter == null) {
			adapter = new SelectAdapter(this);
		}
	listContent.setAdapter(adapter);
	for (String s : jbs) {
		AddItem addItem = new AddItem();
		addItem.setName(s);
		addItems.add(addItem);
	}
		 addItems.addAll(addItems);
		
	}

	@Override
	public void setonCliker() {
		tvSure.setOnClickListener(this);
		tvCancle.setOnClickListener(this);
	
		listContent.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				AddItem item = (AddItem) parent.getAdapter().getItem(position);
				adapter.setSelct(position, !item.isB());
				
			}
		});
		
	}
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.tv_sure://确定
			List<AddItem> items = adapter.getSelects();

			break;
		case R.id.tv_cancle://取消
			ReportActivity.this.finish();
			break;
		default:
			break;
		}
	}


}
